package com.pig4cloud.pigx.admin.api.enums;

public enum FacilitiesTypeEnum {

    OFFICE_SPACE("1", "办公区管理用房"),
    COMMUNICATION_DEVICES("2", "通信设备"),
    WAREHOUSE("3", "防汛物资仓库");

    private String type;
    private String name;

    FacilitiesTypeEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    // 根据类型获取名称
    public static String getNameByType(String type) {
        for (FacilitiesTypeEnum facilitiesTypeEnum : FacilitiesTypeEnum.values()) {
            if (facilitiesTypeEnum.getType().equals(type)) {
                return facilitiesTypeEnum.getName();
            }
        }
        return null;
    }
}
